FlyTalk.views.ProfView = Ext.extend(Ext.Panel, {
     id: 'ProfView',
    indicator: true,
    fullscreen: true,
    layout: 'card', 
        
    initComponent: function () {
              
		this.backButton = new Ext.Button({
		
			iconCls: 'home',
			iconMask: true,
			handler: this.backButtonTap,
			scope: this
		});
		
		
		this.toolbar = new Ext.Toolbar({
				title: 'My Private Profile',
				doc: 'top',
				layout: 'hbox',
				items: [
						this.backButton,
						{xtype: 'spacer'},
						//this.composeButton,
				]
		});
			buttonsGroup2 = new Ext.SegmentedButton({ 
			xtype: 'segmentedbutton',
			allowDepress: false,
			items: [{
				text: 'Details',
				
				//handler: this.backButtonTap,FlyTalk.views.ServicesTabAllView, 
				handler: function () {
					FlyTalk.views.ProfView.setActiveItem(FlyTalk.views.ProfDetailView,{type: 'slide', direction: 'right'});			
				},
				pressed: true
			}, {
				text: 'Badges',
				//padding: '0 30 0 30',
				//handler: this.backButtonTap
				handler: function () {
					FlyTalk.views.ProfView.setActiveItem(FlyTalk.views.ProfBadgeView, {type: 'slide', direction: 'left'});			
				},
			}]
		});
		
		this.toolbartab = new Ext.Toolbar({
			//title: 'Services',
			doc: 'top',
			layout: 'hbox',
			ui: 'toptab',
			items: [
				{xtype: 'spacer'},
			    buttonsGroup2,
				{xtype: 'spacer'},
		
			]
		});
		
		this.dockedItems = [this.toolbar, this.toolbartab];
		
		Ext.apply(FlyTalk.views, {
				ProfDetailView: new FlyTalk.views.ProfDetailView(),
				ProfBadgeView: new FlyTalk.views.ProfBadgeView(),
                        
		});
                
		this.items = [FlyTalk.views.ProfDetailView, FlyTalk.views.ProfBadgeView];
				
		FlyTalk.views.ProfView.superclass.initComponent.call(this);
        
    },
	
	backButtonTap: function () {
        Ext.dispatch({
            controller: FlyTalk.controllers.ftController,
            action: 'openHome'
        });
    },

});